import request from '@/utils/request'
import { microservices } from '@/utils'

export function getSysMenutreeAll (params) {
  return request({
    url: `${microservices.pmsSys}/SysMenu/treeAll`,
    params,
    method: 'get'
  })
}

export function putSysMenu (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenu`,
    data,
    method: 'put'
  })
}

export function putSonSysMenu (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenu`,
    data,
    method: 'put'
  })
}

export function deleteSysMenu (id) {
  return request({
    url: `${microservices.pmsSys}/SysMenu/${id}`,
    method: 'delete'
  })
}

export function postSysMenu (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenu`,
    data,
    method: 'post'
  })
}

export function getSysMenuFunc (params) {
  let sortStr = params.sortStr
  delete params.sortStr
  return request({
    url: `${microservices.pmsSys}/SysMenuFunc?${sortStr}`,
    params,
    method: 'get'
  })
}

export function putSysMenuFunc (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFunc`,
    data,
    method: 'put'
  })
}

export function postSysMenuFunc (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFunc`,
    data,
    method: 'post'
  })
}

export function deleteSysMenuFunc (id) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFunc/${id}`,
    method: 'delete'
  })
}

export function getSysMenuFuncUrl (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFuncUrl`,
    params: data,
    method: 'get'
  })
}

export function putSysMenuFuncUrl (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFuncUrl`,
    data,
    method: 'put'
  })
}

export function deleteSysMenuFuncUrl (id) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFuncUrl/${id}`,
    method: 'delete'
  })
}

export function postSysMenuFuncUrl (data) {
  return request({
    url: `${microservices.pmsSys}/SysMenuFuncUrl`,
    data,
    method: 'post'
  })
}

export function getSysMenu (params) {
  return request({
    url: `${microservices.pmsSys}/SysMenu/${params}`,
    method: 'get'
  })
}

export function getSysMenuTreeAll (params) {
  return request({
    url: `${microservices.pmsSys}/SysMenu/treeAll`,
    method: 'get'
  })
}

export function getqueryAllSystemMap () {
  return request({
    url: `${microservices.pmsSys}/SysSystem/queryAllSystemMap`
  })
}

export function getSysMenuMenuCode (id) {
  return request({
    url: `${microservices.pmsSys}/SysMenu/${id}`
  })
}
